<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="com.example.demo2.DBUtil" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Insert title here</title>
		<link rel="stylesheet" type="text/css" href="css/rest.css"/>
		<style type="text/css">
			body{width: 100%;height: 100%;}
			*{margin: 0;padding: 0;}
				.bjt{background:radial-gradient(#6f4351,#40325b);width: 100%;height: 120px;}
				.huixiang{width: 200px;height: 80px;position: absolute;left: 0px;top: 10px;}
				.ziti{font-size: 25px;font-style: italic;font-family: 宋体;color:#91b5ff ;font-weight: 600;position: absolute;left:180px;top: 44px;}
				li{float: left;font-size: 22px;padding: 10px;margin-left: 60px;color: aqua;}
				.liebiao{position: absolute;left: 300px;top: 35px;}
				.zixuankuang{font-size: 12px;color: gray;width: 210px;height:38px;position: absolute;left: 1100px;top: 38px;border-radius: 50px;}
				.sousuo{width: 40px;height: 38px;position: absolute;left: 1274px;top: 40px;border-radius: 50px;background-color: dimgray;}
				.si{background-color: black;height: 300px;position: relative;top: 2000px;}
				.c1{font-size: 18px;font-weight: 300;color: white;position: absolute;left: 450px;top: 50px;}
				.c1-1{color: red;}
				.c2{font-size: 18px;font-weight: 300;position: absolute;left: 520px;top:80px;color: white;}
				.c3{font-size: 18px;font-weight: 300;color: white;position: absolute;left: 600px;top:120px;}
				.c4{height: 40px;width: 130px;position: absolute;left: 580px;top:180px;}
				.c5{height: 40px;width: 130px;position: absolute;left: 740px;top:180px;}
				.c6{height: 40px;width: 130px;position: absolute;left: 900px;top:180px;}
					li>a{color: white;}
				.java-beijing-1{width: 100%;height: 225px;position: absolute;left: 0px;top:180px;}
				.java-beijing-2{width: 160px;height: 225px;position: absolute;left: 350px;top:190px;}
				.mztkn{color: white;position: absolute;left: 600px;top:190px;}
				.mztkn-1{font-size: 25px;}
				.mztkn-2{font-size: 18px;padding-top: 10px;}
				.mztkn-3{font-size: 15px;padding-top: 10px;}
				.pf{color: white;position: absolute;left: 600px;top:340px;}
				.fenshu{color:yellow;position: absolute;left: 18px;top:26px;font-size: 20px;}
				.piaofang{color: white;position: absolute;left: 700px;top:340px;}
				.piaofang-1{color: yellow;position: absolute;left: 700px;top:367px;font-size: 20px;}
						.denglu>a{color: white;}
				.z1{height: 400px;width: 1000px;border: solid 1px gray;margin-left: 400px;margin-top: 160px;}
				.z1-1{font-size: 24px;margin-top: 30px;width: 1000px;line-height: 50px;font-weight: 400;}
				.z1-2{font-size: 24px;margin-left: 0px;margin-top: 40px;width: 1000px;line-height: 50px;font-weight: 400;}
				.z1-3{font-size: 24px;margin-left: 0px;margin-top: 40px;width: 1000px;line-height: 50px;font-weight: 400;}
				.z1-4{font-size: 24px;margin-left: 0px;margin-top: 40px;width: 1000px;line-height: 50px;font-weight: 400;}
				.z1-1-1{background-color: red;border-radius: 50px;color: white;}
				.z2{font-size: 15px;margin-left: 310px;font-size: 30px;margin-top: 30px;}
				.x1{margin-top: 50px;margin-left: 310px;font-size: 24px;}
				
				.v1{font-size: 30px;height: 40px;width: 160px;margin-top: 100px;border-left: solid 8px red;text-align: center;line-height: 40px;}
			.v2{width: 1000px;padding-bottom: 40px;margin-top: 100px;border-bottom:solid 1px gray;display: flex;
				justify-content: space-between;}
			.v2-1{font-size: 20px;}
			.v2-2{font-size: 20px;color: dimgrey; margin: 10px 0;}
			.v2-3{color: skyblue;border: solid 2px skyblue;background-color: aliceblue;}
			.v3{font-size: 18px;}
			.v3-1{font-size: 20px;color: red;}
			.v4{font-size: 20px;color: white;border-radius: 50px;background-color: red;width: 100px;text-align: center;    margin-top: 10px;}

			.v9{width: 1000px;height: 200px;margin-top: 240px;margin-left: 0px;border-bottom:solid 1px gray;}
			.v9-1{font-size: 20px;}
			.v9-2{font-size: 20px;color: dimgrey;}
			.v9-3{color: skyblue;border: solid 2px skyblue;background-color: aliceblue;}
			.v10{font-size: 18px;position: absolute;left: 1050px;top: 1330px;}
			.v10-1{font-size: 20px;color: red;}
			.v11{font-size: 20px;color: white;border-radius: 50px;background-color: red;width: 100px;text-align: center;position: absolute;left: 1200px;top: 1350px;}
			.z1-1>a:hover {background-color: red;color: white;border-radius: 30px;}
			.z1-2>a:hover {background-color: red;color: white;border-radius: 30px;}
			.z1-3>a:hover {background-color: red;color: white;border-radius: 30px;}
			.z1-4>a:hover {background-color: red;color: white;border-radius: 30px;}
			.v4>a {color: white;}
			.v11>a{color: white;}
			.active{background-color: red;color: white;border-radius: 30px;}

		</style>
	</head>
	<body>
		<div class="bjt">
			<div class="si">
				<div class="c1">关于悦享汇：<span class="c1-1">关于我们	| 管理团队 | 投资者关系 |</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;友情链接：<span class="c1-1">美团网 | 美团下载 | 欢喜首映 |</span></div>
				<div class="c2">QQ邮箱：2112633811.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客服电话：152425125</div>
				<div class="c3">悦享汇用户服务协议 |			悦享汇平台交易规则总则 | 			隐私政策 |</div>
				<img src="img/C9.png"class="c4" >
				<img src="img/C8.png"class="c5" >
				<img src="img/C7.png"class="c6" >
				
			</div>
			<img src="img/R-C.png" class="huixiang">
			<div class="ziti">悦享汇电影</div>
			<div class="liebiao">
				<ul>
				<li><a href="shouye.jsp">首页</a></li>
				<li><a href="dianying.jsp">电影</a></li>
				<li><a href="yingyuan.jsp">影院</a></li>
				<li><a href="bangdan.jsp">榜单</a></li>
				<li><a href="redian.jsp">热点</a></li>
				<li><a href="shangcheng.jsp">商城</a></li>
			</ul>
			</div>
			<%@include file="sousuo.jsp"%>
			<%@include file="dl.jsp"%>

		<%
			String my_id = request.getParameter("id");
			Connection cn = null;
			PreparedStatement ps = null;

			ResultSet rs = null;
			String sql = "";
			cn = DBUtil.getConnection();
			sql = "select * from goods WHERE id=" + my_id;
			ps = cn.prepareStatement(sql);
			rs = ps.executeQuery();
			String name_1 ="";
			String name_2 ="";
			String m_leix ="";
			String img ="";
			String time ="";
			String diqandshic ="";
			String piaof ="";
			String number ="";
			while (rs.next()) {
				 name_1 = rs.getString("name");
				 name_2 = rs.getString("name2");
				 img = rs.getString("img");
				 m_leix = rs.getString("leix");
				 time = rs.getString("time");
				 piaof = rs.getString("piaof");
				 diqandshic = rs.getString("diqandshic");
				 number = rs.getString("number");
			}
		%>
			<div class="java-beijing">
				<img src="img/1237.jpg" class="java-beijing-1" >
				<img src="<%=img%>" class="java-beijing-2">
			</div>
				<div class="mztkn">
						<div class="mztkn-1"><%=name_1%><br></div>
						<div class="mztkn-2"><%=name_2%><br></div>
						<div class="mztkn-3"><%=m_leix%><br><%=diqandshic%><br><%=time%>中国大陆上映</div>
				</div>
				<div class="pf">
					悦享汇口碑
					<div class="fenshu">
						<%=number%>分
					</div>
				</div>
					<div class="piaofang">	累计票房	</div>

						<div class="piaofang-1">
							<%=piaof%>
						</div>


			<div>
				<%
					String r_pinp = request.getParameter("pinp");
					String r_xzq = request.getParameter("xzq");
					String r_leix = request.getParameter("leix");
					String r_fuw = request.getParameter("fuw");

					cn = DBUtil.getConnection();
					sql = "select * from cinema ";
					ps = cn.prepareStatement(sql);
					if (r_pinp !=null){
						sql = sql + "WHERE pinp=?";
						ps = cn.prepareStatement(sql);
						ps.setString(1, r_pinp);
					}
					if (r_xzq !=null){
						sql = sql + "WHERE xzq=?";
						ps = cn.prepareStatement(sql);
						ps.setString(1, r_xzq);
					}
					if (r_leix !=null){
						sql = sql + "WHERE leix=?";
						ps = cn.prepareStatement(sql);
						ps.setString(1, r_leix);
					}
					if (r_fuw !=null){
						sql = sql + "WHERE fuw LIKE\"%"+r_fuw+"%\";";
						System.out.println(sql);
						ps = cn.prepareStatement(sql);
					}
				%>
				<div style="height: 1px"></div>
				<div class="z1" style="margin-top: 8%;padding: 0 40px;">

					<div class="z1-1">
						品牌：
						<%
							String[] name2 = new String[]{"全部","万达影城","百老汇影城","环球影城","万象影城"};
							for (int i = 0;i<name2.length;i++){
						%>
						<a
								style="margin: 0 20px"
								href="goupiao.jsp<%=name2[i] == "全部"?"":"?pinp="+name2[i] + "&id="+my_id%>"
								<%
									if (name2[i].equals(r_pinp)){
								%>
								class="active"
								<%
								} else if (name2[i].equals("全部")) {
									if (r_pinp == null){

								%>
								class="active"
								<%
										}
									}
								%>
						><%=name2[i]%></a>
						<%
							}
						%>
					</div>

					<div class="z1-2">
						行政区：
						<%
							String[] xzq2 = new String[]{"全部","地铁附近","朝阳区","海淀区","丰台区","昌平区","通州区"};
							for (int i = 0;i<xzq2.length;i++){
						%>
						<a
								href="goupiao.jsp<%=xzq2[i] == "全部"?"":"?xzq="+xzq2[i] + "&id="+my_id%>"
								style="margin: 0 20px"
								<%
									if (xzq2[i].equals(r_xzq)){
								%>
								class="active"
								<%
								} else if (xzq2[i].equals("全部")) {
									if (r_xzq == null){

								%>
								class="active"
								<%
										}
									}
								%>
						><%=xzq2[i]%></a>
						<%
							}
						%>
					</div>

					<div class="z1-3">
						影厅类型：
						<%
							String[] leix2 = new String[]{"全部","IMAX厅","4K厅","4D厅"};
							for (int i = 0;i<leix2.length;i++){
						%>
						<a
								href="goupiao.jsp<%=leix2[i] == "全部"?"":"?leix="+leix2[i] + "&id="+my_id%>"
								style="margin: 0 20px"
								<%
									if (leix2[i].equals(r_leix)){
								%>
								class="active"
								<%
								} else if (leix2[i].equals("全部")) {
									if (r_leix == null){

								%>
								class="active"
								<%
										}
									}
								%>
						><%=leix2[i]%></a>
						<%
							}
						%>
					</div>

					<div class="z1-4">
						影院服务：
						<%
							String[] fuw2 = new String[]{"全部","改签","退票"};
							for (int i = 0;i<fuw2.length;i++){
						%>
						<a
								href="goupiao.jsp<%=fuw2[i] == "全部"?"":"?fuw="+fuw2[i] + "&id="+my_id%>"
								style="margin: 0 20px"
								<%
									if (fuw2[i].equals(r_fuw)){
								%>
								class="active"
								<%
								} else if (fuw2[i].equals("全部")) {
									if (r_fuw == null){

								%>
								class="active"
								<%
										}
									}
								%>
						><%=fuw2[i].equals("全部")?"全部":"可"+fuw2[i]%></a>
						<%
							}
						%>

					</div>



				</div>
				<div style="margin-left: 400px">
					<div class="v1">影院列表</div>
					<%
						rs = ps.executeQuery();
						while(rs.next()){
							int id = rs.getInt("id");
							String name = rs.getString("name");
							String pinp = rs.getString("pinp");
							String xzq = rs.getString("xzq");
							String leix = rs.getString("leix");
							String fuw = rs.getString("fuw");
							String jvli = rs.getString("jvli");
							String qian = rs.getString("qian");
							String dizhi = rs.getString("dizhi");
					%>
					<div class="v2">
						<div>
							<div class="v2-1"><%=name%></div>
							<div class="v2-2">地址：<%=dizhi%></div>
							<form action="" method="">
								<%if (fuw.equals("退票/改签")) {%>
								<input type="button" value="退票" class="v2-3"/>
								<input type="button" value="改签" class="v2-3"/>
								<%}else if (fuw.equals("退票")){%>
								<input type="button" value="退票" class="v2-3"/>
								<%}else if (fuw.equals("改签")){%>
								<input type="button" value="改签" class="v2-3"/>
								<%}%>
							</form>
						</div>

						<div style="display: flex;
						flex-direction: column;
						align-items: center;
						margin-right: 5%;"
						>
							<div class="v3">
								<span class="v3-1">&#165;<%=qian%></span> 起 <br> &nbsp;<%=jvli%> </br>
							</div>
							<div class="v4"><a href="xuanzuo.jsp?id=<%=my_id%>&y_id=<%=id%>">选座购票</a></div>
						</div>

					</div>
					<%
						}
					%>
				</div>

			</div>


	</body>
</html>
